package editor.syntaxhighlighter;

import javax.swing.text.Document;
import javax.swing.text.StyledEditorKit;
import javax.swing.text.ViewFactory;

import editor.JavaEditorPane;

/**
 *
 * @author Mark Dessain
 */
@SuppressWarnings("serial")
public class JavaEditorKit extends StyledEditorKit 
{

	public static String LINE_ELEMENT ="line_element";

    private JavaEditorPane edit;

    /**
     * @param edit text-area pane
     */
    public JavaEditorKit(JavaEditorPane edit)
    {
        this.edit = edit;
    }

    /* (non-Javadoc)
     * @see javax.swing.text.StyledEditorKit#createDefaultDocument()
     */
    @Override
    public Document createDefaultDocument() {
        return new JavaDocument(edit);
    }
    
    /* (non-Javadoc)
     * @see javax.swing.text.StyledEditorKit#getViewFactory()
     */
    @Override
    public ViewFactory getViewFactory() {
        return new JavaStyledViewFactory();
    }
}
